<!DOCTYPE html>
<html>
    <head>
        <title>CSS Regions OM Test: getFlowByName</title>
        <link rel="author" title="Alan Stearns" href="mailto:stearns@adobe.com">
        <link rel="help" href="http://www.w3.org/TR/css3-regions/#the-namedflow-interface">
        <meta name="flags" content="dom">
        <meta name="assert" content="The getFlowByName method returns an appropriate value.">
        <script src="/resources/testharness.js"></script>
        <script src="/resources/testharnessreport.js"></script>        
    </head>
    
    <style type="text/css">
        #flow1 {
            -webkit-flow-into: flow1; /*TEMP*/
            flow-into: flow1;
        }
        #flOw1 {
            -webkit-flow-into: flOw1; /*TEMP*/
            flow-into: flOw1;            
        }
    </style>
    <body>
        <div id="log"></div>

        <div id="flow1">foo</div>
        <div id="flOw1">foo</div>
        
        <script type="text/javascript">
            function testGetFlow(flow_name) {
                var namedFlow = document.webkitGetFlowByName(flow_name);
                assert_equals (typeof (namedFlow), "object",
                    "returned value is not an object");
                assert_equals (String (namedFlow), "[object WebKitNamedFlow]", 
                    "returned value is not a NamedFlow");
                return namedFlow;
            }

            function testNullFlow(bad_flow_name) {
                var namedFlow = document.webkitGetFlowByName(bad_flow_name);
                assert_equals (namedFlow, NULL, "Named flow is not NULL");
            }

            function testSeparateFlows(flow_name1, flow_name2) {
                var firstFlow = testGetFlow(flow_name1);
                var secondFlow = testGetFlow(flow_name2);
                assert_not_equals (firstFlow, secondFlow,
                    "Returned flows were the same");
            }

            test( function() {testGetFlow("flow1");},
                "Test created flow."); 
            test( function() {testGetFlow("flow0");},
                "Test non-created flow."); 
            test( function() {testSeparateFlows("flow1", "flOw1");},
                "Test flow name casing."); 
        </script>
    </body>
</html>